package com.secondriver.url.filter.urlrealm

class Subject {

	def sessionid

	def subjectid;

	def Set<String> urls =new HashSet<String>();

	def Subject(sessionid, subjectid, urls){
		this.sessionid=sessionid;
		this.subjectid=subjectid;
		urls?.each { it->
			if(!this.urls.contains(it)){
				this.urls.add(it);
			}
		}
	}

	def String getObjectKey(){
		return sessionid+subjectid;
	}

	@Override
	public String toString() {
		return "Subject [sessionid=${this.sessionid} , subjectid=${this.subjectid} , urls=${this.urls.toString()}]";
	}
}